Fluent APIs in Functional Languages
نویسندگان
چکیده
Fluent API is an object-oriented pattern for elegant APIs and embedded DSLs. A smart fluent can enforce the protocol or DSL syntax at compile time. Since implementations typically rely on overloading function names, they are hard to realize in functional programming languages. This work shows how be implemented absence of name overloading, by relying parametric polymorphism Hindley-Milner type inference. The implementation supports protocols regular- deterministic context-free language classes, even beyond.
منابع مشابه
C APIs in Extension and Extensible Languages
Scripting languages are used in conjuction with C code in two ways: as extension languages, where the interpreter is embedded as a library into an application; or as extensible languages, where the interpreter loads C code as add-on modules. These two scenarios share many similarities, as in both of them two-way communication of code and data needs to take place. However, the differences betwee...
متن کاملThe Multilingual Generation Game: Authoring Fluent Texts in Unfamiliar Languages
There are obvious reasons for trying to automate the production of multilingual documents. Among them are the rapidly growing need for such documents, the high cost and low availability of good translators, and the fact that translators often need more time than is available to produce good multilingual versions. These problems are compounded when equivalent versions of a document are needed in...
متن کاملFunctional Composition of Sensor Web APIs
Web apis are becoming an increasingly popular alternative to the more heavy-weight Web services. Recently, they also have been used in the context of sensor networks. However, making different Web apis (and thus sensors) cooperate often requires a significant amount of manual configuration. Ideally, we want Web apis to behave like Linked Data, where data from different sources can be combined i...
متن کاملAggregation in Functional Query Languages
We consider the problem of improving the computational efficiency of a functional query language. Our focus is on aggregate operations which have proven to be of practical interest in database querying. Since aggregate operations are typically non-monotonic in nature, recursive programs making use of aggregate operations must be suitably restricted in order that they have a well-defined meaning...
متن کاملGPU Programming in Functional Languages
Graphical Processing Units (GPUs) are known to be excellent computation accelerators. However, their approach to data processing is very different from regular CPUs. This makes it harder for a regular developer to program these devices. In the past few years, several frameworks were introduced to simplify the programming of GPU devices. Accelerate and Obsidian are two of these frameworks, writt...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
ژورنال
عنوان ژورنال: Proceedings of the ACM on programming languages
سال: 2023
ISSN: ['2475-1421']
DOI: https://doi.org/10.1145/3586057